//
//  ViewController.swift
//  LVFL
//
//  Created by 李明明 on 16/3/18.
//  Copyright © 2016年 李明明. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
    
    var label: UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        label = UILabel()
        label.text = "hello my beautiful tomorrow!"
        label.frame = CGRectZero
        label.backgroundColor = UIColor.redColor()
        view.addSubview(label)
        
        label.translatesAutoresizingMaskIntoConstraints = false;
        label.clipsToBounds = true;
        let h = NSLayoutConstraint.constraintsWithVisualFormat("H:|-[label(>=10)]", options: .AlignAllLeft, metrics: nil, views: ["label": label])
        let v = NSLayoutConstraint.constraintsWithVisualFormat("V:|-300-[label(>=10)]", options: .AlignAllLeft, metrics: nil, views: ["label":label])
        view.addConstraints(h)
        view.addConstraints(v)
        label.updateConstraints()
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

